package com.beibie.yunpicturebackend.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.beibie.yunpicturebackend.api.imagesearch.aliyunAI.model.CreateOutPaintingTaskResponse;
import com.beibie.yunpicturebackend.common.BaseResponse;
import com.beibie.yunpicturebackend.common.DeleteRequest;
import com.beibie.yunpicturebackend.model.dto.picture.*;
import com.beibie.yunpicturebackend.model.entity.Picture;
import com.beibie.yunpicturebackend.model.entity.User;
import com.beibie.yunpicturebackend.model.vo.PictureVO;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author admin
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-03-03 20:29:40
*/
public interface PictureService extends IService<Picture> {




    /**
     * 上传图片
     *
     * @param inputSource  文件输入源
     * @param pictureUploadRequest
     * @param loginUser
     * @return
     */
    PictureVO uploadPicture(Object inputSource,
                            PictureUploadRequest pictureUploadRequest,
                            User loginUser);

    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);


    /**
     * 获取单个图片封装
     * @param picture
     * @param request
     * @return
     */
    PictureVO getPictureVO(Picture picture, HttpServletRequest request);

    /**
     * 分页获取图片封装
     * @param picturePage
     * @param request
     * @return
     */
    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

    /**
     * 图片数据校验方法，用于更新和修改图片时进行判断
     * @param picture
     */
   void validPicture(Picture picture);

    /**
     * 图片审核
     *
     * @param pictureReviewRequest
     * @param loginUser
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, User loginUser);


    /**
     * 图片审核状态自动填充
     * @param picture
     * @param loginUser
     */
    void fillReviewParam(Picture picture, User loginUser);

    /**
     * 批量抓取和创建图片
     *
     * @param pictureUploadByBatchRequest
     * @param loginUser
     * @return 成功创建的图片数
     */
    Integer uploadPictureByBatch(
            PictureUploadByBatchRequest pictureUploadByBatchRequest,
            User loginUser
    );


    /**
     * 清理图片文件
     *
     * @param picture
     */

    void clearPicureFile(Picture picture);

    /**
     * 校验权限
     * @param loginUser
     * @param picture
     */

    void checkPictureAuth(User loginUser, Picture picture);

    void deletePicture(long pictureId, User loginUser);

    void editPicture(PictureEditRequest pictureEditRequest, User loginUser);


   List<PictureVO> searchPictureByColor(Long spaceid, String picColor, User loginUser);


    /**
     * 批量更新
     * @param pictureEditByBatchRequest
     * @param loginUser
     */
   void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User loginUser);


    /**
     * 阔图
     * @param pictureOutPaintingRequest
     * @param loginUser
     */

    CreateOutPaintingTaskResponse createPictureOutPaintingTask(CreatePictureOutPaintingTaskRequest pictureOutPaintingRequest, User loginUser);


}
